<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <!-- 若您需要使用Kendo UI Professional，请联系版权人获得合法的授权或许可。 -->
    <!-- Bootstrap css -->
    <link href="https://magicbox.bkclouds.cc/static_api/v3/assets/bootstrap-3.3.4/css/bootstrap.min.css" rel="stylesheet">
    <!-- kendo ui css -->
    <link href="https://magicbox.bkclouds.cc/static_api/v3/assets/kendoui-2015.2.624/styles/kendo.common.min.css" rel="stylesheet">
    <link href="https://magicbox.bkclouds.cc/static_api/v3/assets/kendoui-2015.2.624/styles/kendo.default.min.css" rel="stylesheet">
    <!-- font-awesome -->
    <link href="https://magicbox.bkclouds.cc/static_api/v3/assets/fontawesome/css/font-awesome.css" rel="stylesheet">
    <!--蓝鲸提供的公用样式库 -->
    <link href="https://magicbox.bkclouds.cc/static_api/v3/bk/css/bk.css" rel="stylesheet">
    <link href="https://magicbox.bkclouds.cc/static_api/v3/bk/css/bk_pack.css" rel="stylesheet">
    <!-- 如果要使用Bootstrap的js插件，必须先调入jQuery -->
    <script src="https://magicbox.bkclouds.cc/static_api/v3/assets/js/jquery-1.10.2.min.js"></script>
    <!-- 包括所有bootstrap的js插件或者可以根据需要使用的js插件调用　-->
    <script src="https://magicbox.bkclouds.cc/static_api/v3/assets/echarts-2.0/echarts-all.js"></script>
    <script src="https://magicbox.bkclouds.cc/static_api/v3/assets/bootstrap-3.3.4/js/bootstrap.min.js"></script>
    <!-- 包括所有kendoui的js插件或者可以根据需要使用的js插件调用　-->
    <script src="https://magicbox.bkclouds.cc/static_api/v3/assets/kendoui-2015.2.624/js/kendo.all.min.js"></script>
    <script src="https://magicbox.bkclouds.cc/static_api/v3/assets/echarts-2.0/echarts-all.js"></script>
    <script src="https://magicbox.bkclouds.cc/static_api/v3/bk/js/bk.js"></script>
    <!-- 数据埋点统计 -->
    <script src="https://magicbox.bkclouds.cc/static_api/analysis.js"></script>
    <!-- 以下两个插件用于在IE8以及以下版本浏览器支持HTML5元素和媒体查询，如果不需要用可以移除 -->
    <!--[if lt IE 9]><script src="https://magicbox.bkclouds.cc/static_api/v3/assets/js/html5shiv.min.js"></script><script src="https://magicbox.bkclouds.cc/static_api/v3/assets/js/respond.min.js"></script><![endif]-->
</head>

<body class="bg-white" data-bg-color="bg-white">
    <div class="king-page-box">
        <div class="king-container clearfix">
            <div id="demo1" data-ride="carousel" class="carousel slide m0">
                <!-- 图片底部的切换按钮 -->
                <!--必须有data-target="#demo1"，否则控制无效-->
                <ol class="carousel-indicators"> </ol>
                <!-- 图片列表,如需添加文字说明，在item里加上carousel-caption就可以 -->
                <div class="carousel-inner" role="listbox">
                    <!-- 必须有一个item加上active-->
                </div>
                <!--左右的切换按钮-->
                <!--必须有data-target="#demo1"，否则控制无效-->
                <a class="left carousel-control" href="#demo1" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    <span class="sr-only">上一张</span>
                </a>
                <a class="right carousel-control" href="#demo1" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">下一张</span>
                </a>
            </div>
            <!-- 设置面板样式一Start -->
            <!-- 设置面板样式一End -->
            <div class="panel king-panel1 mb0  ">
                <div class="panel-heading king-panel-head1 king-panel-top2">
                    <h3 class="panel-title">问题列表</h3>
                </div>
                <div class="panel-body">
                    <table class="table mb0 pr15 ranger-box ">
                        <thead>
                            <tr>
                                <th style="width: 20%;">序号</th>
                                <th style="width: 20%;">问题内容</th>
                                <th style="width: 20%;">点击查看详情</th>
                            </tr>
                        </thead>
                        <tbody>
                        {% if question_list %}
                        <ul>
                            {% for q in question_list %}
                            <tr>
                                <td style="width: 20%;">{{ q.id }}</td>
                                <td style="width: 20%;">{{ q.question_text }}</td>
                                <td style="width: 20%;"><a href="{{ q.id }}/">投票详情</a></td>
                            </tr>
                            {% endfor %}
                        </ul>
                        {% else %}
                        <p>暂时无数据</p>
                        {% endif %}
                        <!DOCTYPE html>
                        </tbody>
                    </table>
                    <!-- 设置面板Start -->
                    <!-- 设置面板End -->
                </div>
            </div>
        </div>
    </div>
    <script>
        $('.carousel').carousel()
    </script>
    <script>
        $(function(){
                function renderTpl(str, cfg) {
                    var re = /(#(.+?)#)/g;

                    return str.replace(re, function() {
                        var val = cfg[arguments[2]]+'';
                        if(typeof val == 'undefined') {
                            val = '';
                        }
                        return val;
                    });
                }

                // 异步请求后台数据
                $.ajax({
                    url: 'https://magicbox.bkclouds.cc/static_api/v3/components/table6/data.json',
                    type: 'GET',
                    success: function(res){
                        var _html = ' ';
                        var list = res.items;
                        var tpl = $('#tpl_1512828004563').html();
                        var headerTpl =  $('#header_tpl_1512828004563').html();
                        for (var i=0,len=list.length; i < len; i++){
                            var item = list[i];
                            _html += renderTpl(tpl, item)
                        }
                        $('#code_1512828004563 tbody').html(_html);
                        $('.ranger-box thead').html(renderTpl(headerTpl,res.catalogues));
                    }
                });
            });
    </script>
</body>

</html>
